#include <stdio.h>

#include <sys/types.h>
#include <sys/socket.h>


int main()
{
	int fd = socket(AF_INET, SOCK_DGRAM, 0);

	if(fd == -1)
	{
		printf("create socket failed!");
	}

	int recv_buf_len = 0;
	socklen_t sock_len = sizeof(int);
	getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *)&recv_buf_len, &sock_len);
	printf("recv buffer len is %d \n", recv_buf_len);

	//recv_buf_len *= 10;
	int buf_len = 1024 * 80;
	setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *)&buf_len, sizeof(buf_len));

	getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *)&recv_buf_len, &sock_len);
	printf("recv buffer len is %d \n", recv_buf_len);

	return 0;
}
